package com.scm.biz.bean;

import java.io.Serializable;
import java.util.Date;

import net.sf.json.JSONObject;

/**
 * 联系人类：客户的联系人，一个客户可以有多个联系人
 * @author Young
 * @Date 2016.11.14
 *
 */
public class CustomerContact implements Serializable{
	
	private static final long serialVersionUID = 1L;
	
	private Integer id;				//联系人ID
	private Long customerId;		//客户ID   	
	private String linkman;			//联系人
	private String contact;			//联系方式
	private String email;			//邮箱地址
	private String deptPosition;	//职位或者部门
	private Date createAt;			//创建时间
	private Date updateAt;			//更新时间
	public CustomerContact(){
		
	}
	public CustomerContact(JSONObject object){
		this.linkman=object.getString("linkman");
		this.contact=object.getString("contact");
		this.email=object.getString("email");
		this.deptPosition=object.getString("deptPosition");
	}
	public Integer getId() {
		return id;
	}
	public void setId(Integer id) {
		this.id = id;
	}
	public Long getCustomerId() {
		return customerId;
	}
	public void setCustomerId(Long customerId) {
		this.customerId = customerId;
	}
	public String getLinkman() {
		return linkman;
	}
	public void setLinkman(String linkman) {
		this.linkman = linkman;
	}
	public String getContact() {
		return contact;
	}
	public void setContact(String contact) {
		this.contact = contact;
	}
	public String getEmail() {
		return email;
	}
	public void setEmail(String email) {
		this.email = email;
	}
	public String getDeptPosition() {
		return deptPosition;
	}
	public void setDeptPosition(String deptPosition) {
		this.deptPosition = deptPosition;
	}
	public Date getCreateAt() {
		return createAt;
	}
	public void setCreateAt(Date createAt) {
		this.createAt = createAt;
	}
	public Date getUpdateAt() {
		return updateAt;
	}
	public void setUpdateAt(Date updateAt) {
		this.updateAt = updateAt;
	}
	@Override
	public String toString() {
		return "Contact [id=" + id + ", customerId=" + customerId + ", linkman=" + linkman + ", contact=" + contact
				+ ", email=" + email + ", deptPosition=" + deptPosition + ", createAt=" + createAt + ", updateAt="
				+ updateAt + "]";
	}
	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result + ((id == null) ? 0 : id.hashCode());
		return result;
	}
	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		CustomerContact other = (CustomerContact) obj;
		if (id == null) {
			if (other.id != null)
				return false;
		} else if (!id.equals(other.id))
			return false;
		return true;
	}
	
}
